<?php
$this->pageHeader = t('PAGE_TITLE', 'systemMenu');
$this->pageTitle = t('PAGE_TITLE', 'systemMenu');
$toolbar = new LGToolbar();
$toolbar->buttonAddNew('500', '460', t('PAGE_TITLE_ADDNEW', 'systemMenu'));
$toolbar->buttonDelete();
$toolbar->buttonRefresh();
$this->pageToolbar = $toolbar->mergeToolbar();
$this->breadcrumbs = array('System','System Menu');
?>
<div id="ccontent">    
    <div id="message"></div>                               
    <!-- search-form -->                                
    <div class="search-form"> 														
        <?php
        $this->renderPartial('_search', array(
            'model' => $model,
        ));
        ?>
    </div>
    <!-- grid -->
    <?php
    $dataProvider = $model->getListSystemMenu();
    $this->widget('GridView', array(
        'id' => 'DataGrid',
        'dataProvider' => $dataProvider,
        'itemsCssClass' => 'grid',
        'summaryText'=> LGHelpers::getSummary(),
        'columns' => array(
            array(
                'header' => '#',
                'class' => 'CCheckBoxColumn',
                'selectableRows' => '2',
                'id' => 'chkId',
                'htmlOptions' => array('width' => '20px', 'align' => 'center'),
            ),
            array(
                'header' => t('LBL_NAME', 'systemMenu'),
                'name' => 'name',
                'value' => '"<span class=\"indent\">".$data["indent"]."</span>" . CHtml::encode($data["name"])',
                'type' => 'raw',
                'sortable' => TRUE,
            ),
            array(
                'value' => 'CHtml::link(CHtml::encode($data["link"]),CHtml::encode($data["link"]))',
                'header' => t('LBL_LINK', 'systemMenu'),
                'htmlOptions' => array('width' => '200px', 'align' => 'left'),
                'type' => 'raw',
            ),
            array(
                'name' => 'status',
                'header' => t('LBL_STATUS', 'systemMenu'),
                'value' => 'Html::active($data["id"],$data["status"],"active")',
                'htmlOptions' => array('width' => '20px', 'align' => 'center'),
                'type' => 'raw',
            ),
            array(
                'value' => '"<span class=\"display_order\">".$data["display_order"]."</span>". $data["order_column"]',
                'name' => 'display_order',
                'header' => t('LBL_DISPLAY_ORDER', 'systemMenu'),
                'htmlOptions' => array('width' => '80px', 'align' => 'left'),
                'type' => 'raw',
                'sortable' => TRUE,
            ),
            
            array(
                'value' => '$data["update_date"]',
                'header' => t('LBL_UPDATE_DATE', 'systemMenu'),
                'htmlOptions' => array('width' => '120px', 'align' => 'center'),
                'type' => 'raw',
            ),
            array(
                'value' => 'CHtml::encode($data["updated_by"])',
                'header' => t('LBL_UPDATED_BY', 'systemMenu'),
                'htmlOptions' => array('width' => '120px', 'align' => 'center'),
                'type' => 'raw',
            ),
            array(
                'header' => t('LBL_ACTION', 'systemMenu'),
                //'value' => 'Html::iconEdit(' . 'url("systemmenu/update/$data[id]")' . ', "Edit System Menu", 500, 460)',
                'value' =>'Html::buttonInGrid("linkEdit", url("systemmenu/update/$data[id]"), "Edit", "Edit System Menu", "icon edit update-dialog-open-link", "500","460")',
                'htmlOptions' => array('width' => '20px', 'align' => 'center'),
                'type' => 'raw',
            ),
        ),
    ));
    ?>
    <script type="text/javascript">    
        $(document).ready(function(){
            ShowTooltip($(".tooltip"), $("#shareit-box"), "<?php echo url("systemmenu/gettooltip"); ?>");
        });    
    </script>
